package org.ali.structuralpattern.decoratorpattern;

import org.ali.structuralpattern.decoratorpattern.decorator.ShapeDecorator;
import org.ali.structuralpattern.decoratorpattern.decorator.ShapeRedDecorator;
import org.ali.structuralpattern.decoratorpattern.shape.Circular;
import org.ali.structuralpattern.decoratorpattern.shape.Rectangle;
import org.ali.structuralpattern.decoratorpattern.shape.Shape;

/**
 * 装饰器模式
 */
public class Main {
    public static void main(String[] args) {
        Shape circular = new Circular();
        circular.draw();

        Shape rectangle = new Rectangle();
        ShapeDecorator shapeRedDecorator = new ShapeRedDecorator(rectangle);
        shapeRedDecorator.draw();
    }
}
